

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<script type="text/javascript" src="helpman_topicinit.js"></script>

<title>C++ Conventions [Enterprise Architect User Guide]</title>

<meta name="keywords" content="Enterprise Architect, Sparx Systems, UML, Modeling Conventions,Modeling Conventions C++,C++,C++ Modeling Conventions">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="Content-Style-Type" content="text/css" />

<link type="text/css" href="default.css" rel="stylesheet" />
<style type="text/css">
  A, A:Visited
  {
    color: #00F;
  }

  A:Active, A:Hover
  {
    color: #F00;
  }

  OL
  {
    margin: 5px 0 5px 48px;
  }

  UL
  {
    margin-bottom: 3px;
    margin-top: 0;
  }

  #nsr
  {
    background-color: #D4DFFF;
  }

  #nsr A
  {
    text-decoration: none;
  }

  #mainbody
  {
    padding: 8px;
  }

  .p_BodyText
  {
    padding: 5px 0;
  }
</style>



<style type="text/css" media="screen">
  BODY
  {
    background-color: #FFFFFF;
  }

  #nsr
  {
    padding: 6px 6px 0 6px;
    border-bottom: none;
    vertical-align: top;
    z-index: 2;
    visibility: visible;
    left: 0;
    top: 0;
    position: absolute;
  }

  #mainbody
  {
    left: 0;
    top: 0;
    margin: 0;
    position: absolute;
    padding: 10px;
    overflow: auto;
    height: 100%;
    z-index: 1;
    background-repeat: no-repeat;
    background-position: bottom right;
    background-attachment: fixed;
  }
</style>

<style type="text/css" media="print">
  #nsr
  {
    visibility: none;
  }

  #mainbody
  {
    overflow: visible;
  }
</style>
<script type="text/javascript" language="JavaScript" src="nonscroll.js"></script>

</head>
<body scroll="no">

<div id="page">



        <div id="content">
          <div id="content-inner">
          



  
          <div id="nsr">
            <table border="0" cellspacing="0" cellpadding="4" width="100%">
              <tr valign="top">
                <td align="left">
  


                  <p class="p_Heading1"><span class="f_Heading1">C++ Conventions</span></p>



  
                </td>
                <td align="right">
                  <a href="introduction.htm" onmouseover="document.images.main.src='button_main_h.gif'" onmouseout="document.images.main.src='button_main.gif'">
                    <img name="main" src="button_main.gif" border=0 alt="Return to Introduction">
                  </a>&nbsp;
    
                  <a href="csharp_conventions.htm" onmouseover="document.images.prev.src='button_prev_h.gif'" onmouseout="document.images.prev.src='button_prev.gif'">
                    <img name=prev src="button_prev.gif" border=0 alt="Previous page" />
                  </a>&nbsp;
    
    
    
                  <a href="managed_c_conventions.htm" onmouseover="document.images.next.src='button_next_h.gif'" onmouseout="document.images.next.src='button_next.gif'">
                    <img name=next src="button_next.gif" border=0 alt="Next page" />
                  </a>
    
    
                </td>
              </tr>
            </table>
          </div>
          <div id="mainbody">
  


                <p class="p_BodyText"><span class="f_BodyText">Enterprise Architect supports round trip engineering of C++, including the <a href="managed_c_conventions.htm">Managed C++</a> and <a href="cppcli_conventions.htm">C++/CLI</a> extensions, where the following conventions are used.</span></p>
<p class="p_SubHeadingL1"><span class="f_SubHeadingL1">Stereotypes</span></p>
<div style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 5px 0px 5px 13px;"><table cellspacing="0" cellpadding="0" border="0" style="border: none; border-spacing:0px; border-collapse: collapse;">
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="110" bgcolor="#e3e6ed" style="width:110px; background-color:#e3e6ed; border: solid 1px #000000;"><p class="p_Tableheader"><span class="f_Tableheader">Stereotype</span></p>
</td>
<td valign="top" width="175" bgcolor="#e3e6ed" style="width:175px; background-color:#e3e6ed; border: solid 1px #000000;"><p class="p_Tableheader"><span class="f_Tableheader">Applies To</span></p>
</td>
<td valign="top" width="382" bgcolor="#e3e6ed" style="width:382px; background-color:#e3e6ed; border: solid 1px #000000;"><p class="p_Tableheader"><span class="f_Tableheader">Corresponds To</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="110" style="width:110px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">enumeration</span></p>
</td>
<td valign="top" width="175" style="width:175px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Class</span></p>
</td>
<td valign="top" width="382" style="width:382px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">An </span><span class="f_Tabletext" style="font-style: italic;">enum</span><span class="f_Tabletext"> type.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="110" style="width:110px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">friend</span></p>
</td>
<td valign="top" width="175" style="width:175px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Operation</span></p>
</td>
<td valign="top" width="382" style="width:382px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">The </span><span class="f_Tabletext" style="font-style: italic;">friend</span><span class="f_Tabletext"> keyword.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="110" style="width:110px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">property get</span></p>
</td>
<td valign="top" width="175" style="width:175px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Operation</span></p>
</td>
<td valign="top" width="382" style="width:382px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">A read property.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="110" style="width:110px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">property set</span></p>
</td>
<td valign="top" width="175" style="width:175px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Operation</span></p>
</td>
<td valign="top" width="382" style="width:382px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">A write property.</span></p>
</td>
</tr>
<tr style="text-align:left;">
<td width="110" style="width:110px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">struct</span></p>
</td>
<td width="175" style="width:175px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Class</span></p>
</td>
<td width="382" style="width:382px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">A </span><span class="f_Tabletext" style="font-style: italic;">struct</span><span class="f_Tabletext"> type.</span></p>
</td>
</tr>
<tr style="text-align:left;">
<td width="110" style="width:110px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">typedef</span></p>
</td>
<td width="175" style="width:175px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Class</span></p>
</td>
<td width="382" style="width:382px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">A </span><span class="f_Tabletext" style="font-style: italic;">typedef</span><span class="f_Tabletext"> statement, where the parent is the original type name.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="110" style="width:110px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">union</span></p>
</td>
<td valign="top" width="175" style="width:175px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Class</span></p>
</td>
<td valign="top" width="382" style="width:382px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">A </span><span class="f_Tabletext" style="font-style: italic;">union</span><span class="f_Tabletext"> type.</span></p>
</td>
</tr>
</table>
</div>
<p class="p_SubHeadingL1"><span class="f_SubHeadingL1">Tagged Values</span></p>
<div style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 5px 0px 5px 13px;"><table cellspacing="0" cellpadding="0" border="0" style="border: none; border-spacing:0px; border-collapse: collapse;">
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="109" bgcolor="#e3e6ed" style="width:109px; background-color:#e3e6ed; border: solid 1px #000000;"><p class="p_Tableheader"><span class="f_Tableheader">Tag</span></p>
</td>
<td valign="top" width="173" bgcolor="#e3e6ed" style="width:173px; background-color:#e3e6ed; border: solid 1px #000000;"><p class="p_Tableheader"><span class="f_Tableheader">Applies To</span></p>
</td>
<td valign="top" width="383" bgcolor="#e3e6ed" style="width:383px; background-color:#e3e6ed; border: solid 1px #000000;"><p class="p_Tableheader"><span class="f_Tableheader">Corresponds To</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="109" style="width:109px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">afx_msg</span></p>
</td>
<td valign="top" width="173" style="width:173px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Operation</span></p>
</td>
<td valign="top" width="383" style="width:383px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">The </span><span class="f_Tabletext" style="font-style: italic;">afx_msg</span><span class="f_Tabletext"> keyword.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="109" style="width:109px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">anonymous</span></p>
</td>
<td valign="top" width="173" style="width:173px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Class also containing the Tagged Value </span><span class="f_Tabletext" style="font-style: italic;">typedef</span></p>
</td>
<td valign="top" width="383" style="width:383px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">The name of this class being only defined by the</span><span class="f_Tabletext" style="font-style: italic;"> typedef</span><span class="f_Tabletext"> statement.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="109" style="width:109px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">attribute_name</span></p>
</td>
<td valign="top" width="173" style="width:173px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Operation with stereotype </span><span class="f_Tabletext" style="font-style: italic;">property get</span><span class="f_Tabletext"> or </span><span class="f_Tabletext" style="font-style: italic;">property set</span></p>
</td>
<td valign="top" width="383" style="width:383px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">The name of the variable behind this property.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="109" style="width:109px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">bitfield</span></p>
</td>
<td valign="top" width="173" style="width:173px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Attribute</span></p>
</td>
<td valign="top" width="383" style="width:383px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">The size, in bits, allowed for storage of this attribute.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="109" style="width:109px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">bodyLocation</span></p>
</td>
<td valign="top" width="173" style="width:173px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Operation</span></p>
</td>
<td valign="top" width="383" style="width:383px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">The exceptions that are thrown by this method.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="109" style="width:109px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">callback</span></p>
</td>
<td valign="top" width="173" style="width:173px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Operation</span></p>
</td>
<td valign="top" width="383" style="width:383px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">A reference to the </span><span class="f_Tabletext" style="font-weight: bold;">CALLBACK</span><span class="f_Tabletext"> macro.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="109" style="width:109px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">explicit</span></p>
</td>
<td valign="top" width="173" style="width:173px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Operation</span></p>
</td>
<td valign="top" width="383" style="width:383px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">The </span><span class="f_Tabletext" style="font-style: italic;">explicit</span><span class="f_Tabletext"> keyword.</span></p>
</td>
</tr>
<tr style="text-align:left;">
<td width="109" style="width:109px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">initializer</span></p>
</td>
<td width="173" style="width:173px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Operation</span></p>
</td>
<td width="383" style="width:383px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">A constructor initialization list.</span></p>
</td>
</tr>
<tr style="text-align:left;">
<td width="109" style="width:109px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">inline</span></p>
</td>
<td width="173" style="width:173px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Operation</span></p>
</td>
<td width="383" style="width:383px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">The </span><span class="f_Tabletext" style="font-style: italic;">inline</span><span class="f_Tabletext"> keyword and inline generation of the method body.</span></p>
</td>
</tr>
<tr style="text-align:left;">
<td valign="top" width="109" style="width:109px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">mutable</span></p>
</td>
<td valign="top" width="173" style="width:173px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Attribute</span></p>
</td>
<td width="383" style="width:383px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">The location the method body is generated to. Expected values are </span><span class="f_Tabletext" style="font-style: italic;">header, classDec</span><span class="f_Tabletext"> or </span><span class="f_Tabletext" style="font-style: italic;">classBody</span><span class="f_Tabletext">.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="109" style="width:109px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">throws</span></p>
</td>
<td valign="top" width="173" style="width:173px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Operation</span></p>
</td>
<td valign="top" width="383" style="width:383px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">The </span><span class="f_Tabletext" style="font-style: italic;">mutable</span><span class="f_Tabletext"> keyword.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="109" style="width:109px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">typedef</span></p>
</td>
<td valign="top" width="173" style="width:173px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Class with stereotype other than </span><span class="f_Tabletext" style="font-style: italic;">typedef</span></p>
</td>
<td valign="top" width="383" style="width:383px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">This Class being defined in a </span><span class="f_Tabletext" style="font-style: italic;">typedef</span><span class="f_Tabletext"> statement.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="109" style="width:109px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">typeSynonyms</span></p>
</td>
<td valign="top" width="173" style="width:173px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Class</span></p>
</td>
<td valign="top" width="383" style="width:383px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">The</span><span class="f_Tabletext" style="font-style: italic;"> typedef</span><span class="f_Tabletext"> name and/or fields of this type.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="109" style="width:109px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">volatile</span></p>
</td>
<td valign="top" width="173" style="width:173px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Operation</span></p>
</td>
<td valign="top" width="383" style="width:383px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">The </span><span class="f_Tabletext" style="font-style: italic;">volatile</span><span class="f_Tabletext"> keyword.</span></p>
</td>
</tr>
</table>
</div>
<p class="p_SubHeadingL1"><span class="f_SubHeadingL1">Other conventions</span></p>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_Bulletlist1">Namespaces are generated for each package below a <a href="namespaces.htm">namespace root</a></span></li>
</ul>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_Bulletlist1" style="font-style: italic;">By Reference</span><span class="f_Bulletlist1"> attributes correspond to a pointer to the type specified</span></li>
</ul>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_Bulletlist1">The </span><span class="f_Bulletlist1" style="font-style: italic;">Transient</span><span class="f_Bulletlist1"> property of an attribute corresponds to the </span><span class="f_Bulletlist1" style="font-style: italic;">volatile</span><span class="f_Bulletlist1"> keyword</span></li>
</ul>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_Bulletlist1">The </span><span class="f_Bulletlist1" style="font-style: italic;">Abstract</span><span class="f_Bulletlist1"> property of an attribute corresponds to the </span><span class="f_Bulletlist1" style="font-style: italic;">virtual</span><span class="f_Bulletlist1"> keyword</span></li>
</ul>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_Bulletlist1">The </span><span class="f_Bulletlist1" style="font-style: italic;">Const</span><span class="f_Bulletlist1"> property of an operation corresponds to the </span><span class="f_Bulletlist1" style="font-style: italic;">const</span><span class="f_Bulletlist1"> keyword, specifying a constant return type</span></li>
<li><span class="f_Bulletlist1">The </span><span class="f_Bulletlist1" style="font-style: italic;">Is Query</span><span class="f_Bulletlist1"> property of an operation corresponds to the </span><span class="f_Bulletlist1" style="font-style: italic;">const</span><span class="f_Bulletlist1"> keyword, specifying the method doesn't modify any fields</span></li>
</ul>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_Bulletlist1">The </span><span class="f_Bulletlist1" style="font-style: italic;">Pure</span><span class="f_Bulletlist1"> property of an operation corresponds to a </span><span class="f_Bulletlist1" style="font-style: italic;">pure virtual</span><span class="f_Bulletlist1"> method using the &quot;</span><span class="f_Bulletlist1" style="font-weight: bold;">= 0</span><span class="f_Bulletlist1">&quot; syntax</span></li>
</ul>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_Bulletlist1">The </span><span class="f_Bulletlist1" style="font-style: italic;">Fixed</span><span class="f_Bulletlist1"> property of a parameter corresponds to the </span><span class="f_Bulletlist1" style="font-style: italic;">const</span><span class="f_Bulletlist1"> keyword.</span></li>
</ul>
<p class="p_SeeAlso"><span class="f_SeeAlso">See Also</span></p>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_Bulletlist1"><a href="o316.htm">Import Source Code</a></span></li>
<li><span class="f_Bulletlist1"><a href="generatesourcecode.htm">Generate Source Code</a></span></li>
</ul>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_Bulletlist1"><a href="cgo_cpp.htm">C++ Options</a></span></li>
</ul>




            </div>
          </div>
        </div>



</div>


</body>
</html>
